package com.xu.cloud.common.api;

import org.springframework.core.annotation.AliasFor;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMethod;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * api方法注解
 *
 * @author xuguan
 * @since 2024/4/15
 */
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface XuApiMethod {

    @AliasFor("apiCode")
    String value() default "";

    /**
     * api code
     */
    @AliasFor("value")
    String apiCode() default "";

    /**
     * api description
     */
    String apiDesc() default "";

    /**
     * api path
     */
    String[] path() default {};

    /**
     * api method
     */
    RequestMethod[] method() default {RequestMethod.POST};

    /**
     * api consumes
     */
    String[] consumes() default {};

    /**
     * api produces
     */
    String[] produces() default {MediaType.APPLICATION_JSON_VALUE};

    /**
     * api processor bean name
     */
    String processorBeanName() default "";
}
